<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        span {
            display: inline-block;
            width: 80px;
            height: 30px;
            border: black solid .013333rem;
            background-color: black;
            color: white;
            line-height: 30px;
            text-align: center;
        }
    </style>

</head>

<body>

</body>
<script>
    //正直角
    // var str = "";
    // for (var num = 1; num <= 9; num++) {
    //     for (var j = 1; j <= num; j++) {
    //         // str += ' ' + j + '*' + num + "=" + (num * j) + '  ';
    //         document.write('<span>' + j + '*' + num + "=" + (num * j) + ' </span>')
    //     }
    //     // str += '\n'
    //     document.write('<br/>')
    // }
    //....................................................................................
    // 倒直角
    var str = "";
    for (var num = 9; num >= 1; num--) {
        for (var j = num; j >= 1; j--) {
            // str += ' ' + num + '*' + j + "=" + (num * j) + '  ';
            document.write('<span>' + j + '*' + num + "=" + (j * num) + ' </span>')
        }
        // str += '\n'
        document.write('<br/>')
    }
</script>

</html>